#! usr/bin/node

const log = console.log;

log(`dir name: ${__dirname}`);
log(`file name: ${__filename}`);

//方案一：最好
const path = require('path');
let fileName1 = path.join(__dirname, 'views', 'login.html');
log('fileName1:', fileName1);

//方案二：不好，没有考虑跨平台
let fileName2 = __dirname + '/views/wiew.html';
log('fileName2:', fileName2);

//方案三：不好，代码复杂，平台考虑不全面
let fileName3;
switch(process.platform){
  case 'linux':
    fileName3 = __dirname + '/view/view.html';
    break;
  case 'win32':
    fileName3 = __dirname + '\\view\\view.html';
    break;
  default:
    fileName3 = 'something woring';
}
log('fileName3:', fileName3);
